Skip to content

feat(neutron): add reservation-aware quota monitoring and project identity - #6

Open
davidhulick wants to merge 2 commits into
contrib/octavia-quotas-2b3from
contrib/neutron-quotas-2b6
Open

davidhulick wants to merge 2 commits into
contrib/octavia-quotas-2b3from
contrib/neutron-quotas-2b6

Conversation

@davidhulick

Copy link
Copy Markdown

Summary

Improve Neutron quota monitoring by incorporating active reservations, correcting project ownership and malformed-record handling, and enriching quota metrics with Keystone project identity.

This change extends the existing Neutron quota metrics without introducing new resource families or changing their units.

The implementation uses the current raw reservation query API from [openstackdb PR #4](samaritanark/openstackdb#4).

Changes

Neutron quota accounting

  • Support all nine Neutron quota resources: floating IPs, networks, ports, routers, security groups, security group rules, subnets, subnet pools, and RBAC policies.
  • Report configured and persisted quota limits, resource usage, and active reservations.
  • Aggregate raw reservation deltas by project and resource, preserving signed values and using 64-bit accumulation.
  • Detect duplicate reservation/resource records and invalid NULL or negative reservation amounts.
  • Prevent malformed records from corrupting valid quota accounting.
  • Include projects discovered through quota limits, resource usage, reservations, or available Keystone metadata.
  • Preserve system-owned resource handling and isolate malformed project/resource scopes.

Reservation expiration

  • Use the database's UTC clock to select active reservations.
  • Include reservations expiring exactly at the query cutoff.
  • Exclude expired reservations and records with NULL expiration.
  • Aggregate reservations across multiple expiration groups without double-counting.

Project identity and metadata

  • Add tenant_id and domain_id labels alongside the existing tenant and type labels.
  • Add context-bounded Keystone metadata refresh for Neutron quota collection.
  • Preserve cached project metadata when refresh fails.
  • Fall back to project UUIDs when metadata is unavailable.
  • Sanitize Keystone connection error logging to avoid exposing sensitive connection details.

Metric compatibility: Adding identity labels changes the label sets of existing Neutron quota series. Dashboards, recording rules, and alerts selecting these metrics may require updates.

Configuration and health

  • Support Neutron quota defaults through the existing shared quota defaults configuration.
  • Validate required and optional resource defaults.
  • Add openstack_neutron_quota_up to report quota collection health independently of inventory health.
  • Add openstack_neutron_quota_skipped_records to expose malformed accounting records.
  • Preserve Neutron inventory collection and HTTP availability when quota configuration or collection fails.

Native integration testing

Added TestIntegration_E2E_NeutronReservations to exercise actual reservation accounting through MariaDB and the exporter's HTTP metrics endpoint.

The test covers active and expired reservations, all nine resource families, malformed accounting, quota collection failures, and recovery.

The test and fixtures were independently reviewed, but native MariaDB integration and E2E execution remain outstanding because Docker was unavailable in the validation environment.

Dependencies

This contribution is stacked on the Octavia exporter contribution in contrib/octavia-quotas-2b3.

It requires the pending public openstackdb contributions:

Validation used a temporary workspace combining these library contributions.

The committed module currently references openstackdb v0.2.1, which lacks the required APIs. A dependency update and standalone CI validation will be necessary when compatible upstream revisions become available.

Known limitations and follow-up work

  • Native MariaDB and exporter E2E tests must be executed on a Docker-capable runner before upstream submission.
  • The existing conservative malformed-owner policy can suppress a resource's metrics across multiple projects when an invalid whitespace-only owner is encountered.
  • The skipped-record metric counts malformed raw reservation deltas individually; its HELP text should be clarified before final upstream submission.
  • Additional regression coverage for valid zero-valued reservation deltas is recommended.
  • Representative reservation-query performance and latency have not yet been measured.

Scope

This PR is limited to Neutron quota monitoring, active reservation accounting, project identity resolution, configuration, and related tests.

It does not include unrelated Cinder, Manila, or Nova changes.

Signed-off-by: David Hulick <dave.hulick@gmail.com>
Signed-off-by: David Hulick <dave.hulick@gmail.com>
@davidhulick davidhulick changed the title Contrib/neutron quotas 2b6 feat(neutron): add reservation-aware quota monitoring and project identity Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant